package com.ZeroCarbon.service;

import com.ZeroCarbon.domain.dto.PostDetailDTO;
import com.ZeroCarbon.domain.dto.PostEditDTO;
import com.ZeroCarbon.domain.dto.PostPreviewDTO;
import com.ZeroCarbon.domain.dto.PostReceiverDTO;
import com.ZeroCarbon.domain.po.Post;
import com.ZeroCarbon.entity.PageObject;
import com.ZeroCarbon.exception.BusinessLogicException;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.IOException;
import java.util.List;

public interface IPostService extends IService<Post> {
    void savePost(PostReceiverDTO postDTO) throws IOException, BusinessLogicException;

    List<PostPreviewDTO> getRandomPost(int type, boolean isFavorite) throws BusinessLogicException;

    Integer thumbsUpPost(String id) throws BusinessLogicException;

    PostDetailDTO getDetailPost(String id) throws BusinessLogicException;

    PageObject getCurrentPosts(int page, int size) throws BusinessLogicException;

    PostEditDTO getEditPost(String id) throws BusinessLogicException;

    void updateEditPost(PostEditDTO postEditDTO) throws BusinessLogicException;

    void deletePost(String id) throws BusinessLogicException;

    Integer collectPost(String id) throws BusinessLogicException;

    Boolean isFavorite(String id);

    List<PostPreviewDTO> getUserHistory() throws BusinessLogicException;

    List<PostPreviewDTO> searchPost(String search) throws BusinessLogicException;
}
